<template>
    <div class="all">
        <div class="t">用户名：</div>{{ name }}
        <el-button type="primary" @click="get()">获取</el-button>
        <router-view></router-view>
        
    </div>
</template>
<script>
    import {mapState} from 'vuex'
    console.log(mapState(['name']))
    
    const options={
        computed:{
            ...mapState(['name'])
        },
        data(){
            return{
                //name:''
            }
        },
        methods:{
            get(){
                //this.name=sessionStorage.getItem("name")
            }
        }
    }
    export default options
</script>